<template>
  <div class="container">

    <!-- 监听告警事件，执行额外逻辑 -->
    <building-monitor @alarm-events="handleAlarmEvents" />
  </div>
</template>

<script>
import BuildingMonitor from '@/components/BuildingMonitor/'

export default {
  name: "Test",
  components: {
    'building-monitor': BuildingMonitor
  },
  methods: {
    handleAlarmEvents(elevator) {
      // 这里可以执行额外的逻辑，比如记录日志、发送统计等
      console.log('告警事件被点击:', elevator);
      // 注意：不需要再写跳转逻辑，组件内部已经处理了
    }
  }
}
</script>
